google.load("search", "1", {"language" : "de"});

function runSearch(siteUrl, searchFormInputFieldName) {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Set the Search Control to get the most number of results
  searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);

  // create a draw options object so that we
  // can position the search form root
  var drawOptions = new google.search.DrawOptions();
  //options.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);


  // Add in a full set of searchers var webSearch = new 
  var webSearch = new google.search.WebSearch(); 
  webSearch.setSiteRestriction(siteUrl);         

  var searcherOptions = new google.search.SearcherOptions();
  searcherOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);

  searchControl.addSearcher(webSearch, searcherOptions);
  searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);

  // Tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("content-main"), drawOptions);
  
  var searchFormInputField = document.getElementById(searchFormInputFieldName);  
  
  searchControl.execute(searchFormInputField.value);
}
